<template>
  <div>
    <el-table @row-click="tableclick" :header-cell-style="{ backgroundColor: '#f6f4fc' }" :data="b_tableData_3"
      style="width: 100%" class="b_tableData_3_box">
      <el-table-column prop="ranking" label="排名" width="100">
        <template slot-scope="scope">
          <span class="">
            TOP{{ scope.row.ranking }}
          </span>
        </template>
      </el-table-column>

      <el-table-column prop="company" label="公司">
        <template slot-scope="scope">
          <span class="">
            {{ scope.row.company }}
          </span>
        </template>
      </el-table-column>

      <el-table-column prop="end" label="数量" width="100">
        <template slot-scope="scope">
          <span class="">
            {{ scope.row.end }}
          </span>
        </template>
      </el-table-column>

      <el-table-column prop="street" label="镇街" width="100">
        <template slot-scope="scope">
          <span class="">
            {{ scope.row.street }}
          </span>
        </template>
      </el-table-column>
      <!-- <el-table-column  label="">
        <template slot-scope="scope">
          <span class="item_list item_demand2" v-if="scope.row.label == 2">
            已走访
          </span>
        </template>
      </el-table-column> -->
    </el-table>
  </div>
</template>

<script>
import { visitDetailtwo } from '@/api/newuser'

export default {
  components: {},
  props: {
    b_tableData_3: {
      type: Array,
      default: function () {
        return {
          label: Number,
          company: String,
          ranking: Number
        }
      }
    },
    b_tableData_3_date: {
      type: String,
      default: function () {
        return ''
      }
    }
  },
  data() {
    return {

    };
  },
  mounted() {
    // console.log(this.b_tableData);
  },
  methods: {
    tableclick(row) {

      this.$router.push({
        path: '/workEnterprisevisit',
        query: {
          company_id: row.company_id,
          company_name: row.company,
        }
      })
      
      //判断是否有走访记录
      // visitDetailtwo({
      //   company_id: row.company_id
      // }).then(res => {
      //   // console.log(res);
      //   if (res.list.length == 0) {
      //     this.$router.push(
      //       {
      //         path: '/addWaitvisit',
      //         query: {
      //           company_name: row.company_name,
      //           company_id: row.company_id,
      //         }
      //       }
      //     )
      //   } else {
      //     this.$router.push({
      //       path: '/workEnterprisevisit',
      //       query: {
      //         company_id: row.company_id,
      //       }
      //     })
      //   }
      // })
    },
  },
};
</script>

<style scoped lang="less">
.item_list {
  display: inline-block;
  background-color: #D3E2FF;
  margin: 0px 5px;
  border-radius: 5px;
  padding: 0px 5px;
  color: #387DFF;
  font-weight: initial;
  font-size: 10px;
}

.item_demand2 {
  background-color: #FFF6F5;
  font-size: 14px;
  color: #FF5F58;
  border: 1px solid #FF5F58;
}

@media (max-width: 1360px) {}

@media (max-width: 1280px) {}
</style>
